package online.cmagic.structureType.composite;

import java.util.List;

/**
 * @author wangsc
 * @date: 2020年04月14日 20:27
 * @since JDK 1.8
 */
public class Employee {

    private String name;
    private String dept;
    private int salary;
    private List<Employee> employee;

    public Employee(String name, String dept, int salary) {
        this.name = name;
        this.dept = dept;
        this.salary = salary;
    }

    public void add(Employee employee){
        this.employee.add(employee);
    }

    public void remove(Employee employee){
        this.employee.remove(employee);
    }

    public List<Employee> getEmployee(){
        return this.employee;
    }

    public String toString() {
        return ("name:"+name+" dept:"+dept+" salary"+salary);
    }
}
